package com.example.om_export.app.report.controller;

import com.example.om_export.app.report.entity.DocumentTemplateField;
import com.example.om_export.app.report.entity.ReportTemplate;
import com.example.om_export.app.report.service.ReportTemplateService;
import com.example.om_export.common.entity.Params;
import com.example.om_export.common.entity.Result;
import com.example.om_export.common.utils.LayuiDataGrid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

@RestController
@RequestMapping("/uc_report")
public class ReportTemplateController {
    @Autowired
    ReportTemplateService rts;

    //模板保存方法
    @PostMapping("/addReportTemplate")
    public Result addReportTemplate(HttpServletResponse response, ReportTemplate report){
        return rts.save(report);
    }

    @GetMapping("/delete")
    public Result deleteTemplate(HttpServletResponse response,String id){
        return rts.delete(id);
    }
    @RequestMapping("/list")
    @ResponseBody
    public LayuiDataGrid getlist(Integer page, Integer limit){
        return rts.getList(page,limit);
    }



}
